-
Notifications
You must be signed in to change notification settings - Fork 41
chore(ci): Add dev tests with master dependencies #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@kramaranya: GitHub didn't allow me to assign the following users: briangallagher. Note that only kubeflow members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Pull Request Test Coverage Report for Build 16750375247Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kramaranya Thanks for this!
/lgtm
|
/lgtm That's great, thanks! |
|
@astefanutti @Electronic-Waste thanks for your review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this @kramaranya!
python/pyproject.toml
Outdated
| [dependency-groups] | ||
| dev = [ | ||
| "ruff>=0.12.2", | ||
| "kubeflow_trainer_api@git+https://github.com/kubeflow/trainer.git@master#subdirectory=api/python_api", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any use-case when users would like to install Kubeflow SDK with the latest module package ?
IIUC, the dependency-groups is never published to PyPI by hatch, so users can't install.
Thoughts @astefanutti @szaher @briangallagher @kramaranya @eoinfennessy ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I've been thinking about adding this to project.optional-dependencies as well, but since we don't update API models that often, it makes sense to me to keep models from master available only for testing. However, I'm open to other suggestions if you see it differently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my point of view, since we allow to install control plane with the latest changes, users might want to experiment with it during the development: https://www.kubeflow.org/docs/components/trainer/operator-guides/installation/#installing-the-kubeflow-trainer-controller-manager
This gives opportunities for them to quickly adopt newer API changes into their systems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, let me update it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 4d8967f
Makefile
Outdated
| .PHONY: test-python-dev | ||
| test-python-dev: uv-venv | ||
| @uv pip install --project $(PY_DIR) --group dev "$(PY_DIR)[test]" | ||
| @uv run coverage run --source=kubeflow.trainer.api.trainer_client,kubeflow.trainer.utils.utils -m pytest ./python/kubeflow/trainer/api/trainer_client_test.py | ||
| @uv run coverage report -m kubeflow/trainer/api/trainer_client.py kubeflow/trainer/utils/utils.py | ||
| ifeq ($(report),xml) | ||
| @uv run coverage xml | ||
| else | ||
| @uv run coverage html | ||
| endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we run tests over the master modules for now ?
Since we can't introduce any breaking changes to the Kubernetes API, I don't see a need to run tests against released modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we can't introduce any breaking changes to the Kubernetes API
Hmm, why can't we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to Kubernetes API best practices, if we introduce any breaking changes to the existing API: v1alpha1, we have to create the newer API version, for instance: v1alpha2: https://kubernetes.io/docs/reference/using-api/deprecation-policy/
In the future, we should discuss how to design our SDK to make it compatible with supported API versions, but we are not there yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for explanation! That makes sense now to test it only against master branch
Updated in 4d8967f
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, we discussed before that this part is not needed given that we don't have limitations on concurrent runs due to GitHub enterprise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A use case is re-pushing the branch for the PR while the workflow is running. Even with no limitations, is that useful to keep the existing run going?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be useful to compare results, but I am fine to cancel them for now.
@kramaranya Please can you apply the change to all GitHub action tests in that case ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, updated in 4853da4
.github/workflows/test-python.yaml
Outdated
| flag-name: ${{ matrix.dependency-group.name }}-py${{ matrix.python-version }} | ||
| parallel: true | ||
|
|
||
| coverage: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we run coverage as part of the previous job in Upload coverage to Coveralls step ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I can see, it shows the report on the PRs: #56 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I added the parallel + “coverage-finished” step there when the matrix had four legs (dev/prod × two Python versions), so Coveralls could wait for every flag upload before closing the build and merging reports -- https://docs.coveralls.io/parallel-builds
But I've removed it in 189139d since we're now testing against the master modules only
|
/test all |
|
@kramaranya: No presubmit jobs available for kubeflow/sdk@main In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: kramaranya <kramaranya15@gmail.com>
Signed-off-by: kramaranya <kramaranya15@gmail.com>
Signed-off-by: kramaranya <kramaranya15@gmail.com>
Signed-off-by: kramaranya <kramaranya15@gmail.com>
Signed-off-by: kramaranya <kramaranya15@gmail.com>
Signed-off-by: kramaranya <kramaranya15@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also migrate to the official package as part of this PR: https://pypi.org/project/kubeflow-trainer-api/
Signed-off-by: kramaranya <kramaranya15@gmail.com>
Signed-off-by: kramaranya <kramaranya15@gmail.com>
Signed-off-by: kramaranya <kramaranya15@gmail.com>
Signed-off-by: kramaranya <kramaranya15@gmail.com>
Signed-off-by: kramaranya <kramaranya15@gmail.com>
|
@andreyvelich @astefanutti thank you for the review! Line 31 in e84a54f
Please let me know if there's anything else I should update! |
|
/lgtm Thanks @kramaranya! |
CONTRIBUTING.md
Outdated
|
|
||
| Install development tools: | ||
| ```sh | ||
| pip install pytest black isort flake8 coverage pre-commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess, we can remove it since we have everything in dev, right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, updated in cb1c4df
Makefile
Outdated
| .PHONY: test-python | ||
| test-python: uv-venv | ||
| @uv pip install "./python[test]" | ||
| @uv pip install --project $(PY_DIR) --group dev "$(PY_DIR)[test,dev]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, shall we also add pre-commit package to dev?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sure!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, updated in cb1c4df!
Signed-off-by: kramaranya <kramaranya15@gmail.com>
|
@andreyvelich thank you for the review! Let me please know if there's anything else I should update! |
Makefile
Outdated
| .PHONY: test-python | ||
| test-python: uv-venv | ||
| @uv pip install "./python[test]" | ||
| @uv pip install --project $(PY_DIR) -e "$(PY_DIR)[dev]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this --project flag ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it for project isolation, but since we have only one project right now, I can remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 542ddcd
Signed-off-by: kramaranya <kramaranya15@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @kramaranya!
/lgtm
/approve
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andreyvelich The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
I added a test-python-dev target and changed the unit test CI jobs with a dev/prod matrix
Dev leg installs the dev dependency group, which now pulls
kubeflow_trainer_apifrom the master branch. Prod leg will run with the packages published to PyPI (once API models are available there)I also updated the CI job to run unit tests for two Python vesions --
3.9and3.11I removed flake8 since ruff replaced it
/assign @andreyvelich @astefanutti @Electronic-Waste @tenzen-y @briangallagher
Checklist: